package com.mo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.mo.service.BackendUserService;

@Controller
@RequestMapping("/backendUser")
public class BackendUserController {
    
	@Autowired
	private BackendUserService backendUserService;
	
	@RequestMapping("/denglu")
	public String denglu(){
		return "denglu.jsp";
		
	}
	
	@RequestMapping("/houtai")
	public String houtai(){
		return "houtai.jsp";	
	}
	
	@RequestMapping("/panduan")
	public String panduan(String name,String pass,Model model){
	 boolean is=backendUserService.denglu1(name, pass);
	 model.addAttribute("name", name);
	 System.out.println(name);
	 System.out.println(pass);
	 System.out.println(is);
	  if(is){
		  return "chenggong.jsp";
	  }else{
		  return "houtai.jsp";
	  }
	
	}

	public BackendUserService getBackendUserService() {
		return backendUserService;
	}

	public void setBackendUserService(BackendUserService backendUserService) {
		this.backendUserService = backendUserService;
	}

	public BackendUserController(BackendUserService backendUserService) {
		super();
		this.backendUserService = backendUserService;
	}

	public BackendUserController() {
		super();
		// TODO Auto-generated constructor stub
	}
	
	
}
